import 'package:C20Driver/pages/carpool_page/carpool_passanger_map.dart';
import 'package:C20Driver/pages/user_module/certificates_info.dart';
import 'package:C20Driver/pages/user_module/personal_detail_data.dart';
import 'package:C20Driver/pages/user_module/wallet/bill_tab_detail.dart';
import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:C20Driver/pages/car_hailing_module/pick_up_passengers.dart';
import 'package:C20Driver/pages/general_module/about.dart';
import 'package:C20Driver/pages/general_module/app_set_up.dart';
import 'package:C20Driver/pages/general_module/customer_service_center.dart';
import 'package:C20Driver/pages/general_module/details_message.dart';
import 'package:C20Driver/pages/general_module/invite_good_friends.dart';
import 'package:C20Driver/pages/general_module/login.dart';
import 'package:C20Driver/pages/general_module/order_mode_settings.dart';
import 'package:C20Driver/pages/general_module/qr_code_collection.dart';
import 'package:C20Driver/pages/general_module/set_collection_amount.dart';
import 'package:C20Driver/pages/general_module/urban_choice.dart';
import 'package:C20Driver/pages/general_module/web_view.dart';
import 'package:C20Driver/pages/carpool_page/carpool_fellow_passengers.dart';
import 'package:C20Driver/pages/carpool_page/carpool_pickup_passengers.dart';
import 'package:C20Driver/pages/carpool_page/carpool_trip.dart';
import 'package:C20Driver/pages/carpool_page/generate_windmill_trip.dart';
import 'package:C20Driver/pages/general_module/location_search_page.dart';
import 'package:C20Driver/pages/carpool_page/looking_passengers.dart';
import 'package:C20Driver/pages/carpool_page/take_passengers.dart';
import 'package:C20Driver/pages/intercity_car/flight_passengers.dart';
import 'package:C20Driver/pages/intercity_car/get_on_by_ticket.dart';
import 'package:C20Driver/pages/taxi_driver_application/professional_qualification.dart';
import 'package:C20Driver/pages/user_module/agreement_record.dart';
import 'package:C20Driver/pages/user_module/authorization_record.dart';
import 'package:C20Driver/pages/user_module/cash_withdrawal.dart';
import 'package:C20Driver/pages/user_module/cash_withdrawal_submission.dart';
import 'package:C20Driver/pages/car_hailing_module/confirmed_amount.dart';
import 'package:C20Driver/pages/user_module/my_income_record.dart';
import 'package:C20Driver/pages/index_page/index_page.dart';
import 'package:C20Driver/pages/intercity_car/intercity_pick_up_passengers.dart';
import 'package:C20Driver/pages/taxi_driver_application/audit_in_progress.dart';
import 'package:C20Driver/pages/taxi_driver_application/authentication_audit.dart';
import 'package:C20Driver/pages/car_hailing_module/cancellation_order.dart';
import 'package:C20Driver/pages/car_hailing_module/details_of_itinerary_orders.dart';
import 'package:C20Driver/pages/taxi_driver_application/driver_registration.dart';
import 'package:C20Driver/pages/taxi_driver_application/driving_license_vehicle.dart';
import 'package:C20Driver/pages/car_hailing_module/end_trip.dart';
import 'package:C20Driver/pages/index_page/home_page/home_page.dart';
import 'package:C20Driver/pages/user_module/itinerary_order/itinerary_order.dart';
import 'package:C20Driver/pages/user_module/itinerary_order_details.dart';
import 'package:C20Driver/pages/taxi_driver_application/new_vehicle_information.dart';
import 'package:C20Driver/pages/user_module/order_statistics.dart';
import 'package:C20Driver/pages/taxi_driver_application/publicity_introduction.dart';
import 'package:C20Driver/pages/car_hailing_module/successful_cancellation_order.dart';
import 'package:C20Driver/pages/taxi_driver_application/upload_id_card.dart';
import 'package:C20Driver/pages/taxi_driver_application/vehicle_owner_audit.dart';
import 'package:C20Driver/pages/user_module/details_system_notification.dart';
import 'package:C20Driver/pages/user_module/message_center.dart';
import 'package:C20Driver/pages/user_module/modify_nickname.dart';
import 'package:C20Driver/pages/user_module/my_qr_code.dart';
import 'package:C20Driver/pages/user_module/my_vehicle.dart';
import 'package:C20Driver/pages/user_module/personal_center.dart';
import 'package:C20Driver/pages/user_module/personal_data.dart';
import 'package:C20Driver/pages/user_module/real_name_authen.dart';
import 'package:C20Driver/pages/user_module/real_name_authentication.dart';
import 'package:C20Driver/pages/user_module/wallet/wallet.dart';

/* *
 * handler就是每个路由的规则，编写handler就是配置路由规则，
 * 比如我们要传递参数，参数的值是什么，这些都需要在Handler中完成。
 */
// 404页面
Handler notFoundHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return Container();
  },
);

// 首页
// Handler homePageHanderl = Handler(
//   handlerFunc: (BuildContext context, Map<String, List<String>> params) {
//     return HomePage();
//   },
// );

// 首页
Handler indexPageHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return IndexPage();
  },
);

// 登录页面
Handler loginHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return Login();
  },
);

// 车主入驻
Handler driverRegistrationHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return DriverRegistration();
  },
);

// 加入网约车
Handler publicityIntroductionHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String type = params['type'].first;
    return PublicityIntroduction(type: type);
  },
);

// 城市选择
Handler urbanChoiceHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return UrbanChoice();
  },
);

// 车主注册
Handler authenticationAuditHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String type = params['type'].first;
    return AuthenticationAudit(type: type);
  },
);

// 上传身份证和驾驶证
Handler uploadIdCardHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return UploadIdCard();
  },
);

// 行驶证与车辆
Handler drivingLicenseVehicleHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return DrivingLicenseVehicle();
  },
);

// 网约车驾驶证与车辆运营证
Handler professionalQualificationHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return ProfessionalQualification();
  },
);

// 车主车辆审核提交成功
Handler vehicleOwnerAuditHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return VehicleOwnerAudit();
  },
);

// 车主车辆审核中
Handler auditInProgressHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return AuditInProgress();
  },
);

// 我的流水
Handler myIncomeRecordHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return MyIncomeRecord();
  },
);

// 模式设置
Handler orderModeSettingsHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return OrderModeSettings();
  },
);

// C20出行看板
Handler orderStatisticsHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return OrderStatistics();
  },
);

// 消息中心
Handler messageCenterHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return MessageCenter();
  },
);

// 系统通知详情
Handler detailsSystemNotificationHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String headTitle = params['headTitle'].first;
    return DetailsSystemNotification(id: id, headTitle: headTitle);
  },
);

// 消息详情
Handler detailsMessageHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    String userName = params['userName'].first;
    return DetailsMessage(orderId: orderId, userName: userName);
  },
);

// 个人中心
Handler personalCenterHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return PersonalCenter();
  },
);

// 个人资料
Handler personalDataHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return PersonalData();
  },
);

// 我的车辆(信息)
Handler myVehicleHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return MyVehicle();
  },
);

// 车辆信息(新增车辆信息)
Handler newVehicleInformationHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return NewVehicleInformation();
  },
);

// 去接乘客
Handler pickUpPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    return PickUpPassengers(orderId: orderId);
  },
);

// 行程详情(行程订单详情)
Handler detailsOfItineraryOrdersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    return DetailsOfItineraryOrders(orderId: orderId);
  },
);

// 取消订单
Handler cancellationOrderHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    return CancellationOrder(orderId: orderId);
  },
);

// 取消订单成功
Handler successfulCancellationOrderHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return SuccessfulCancellationOrder();
  },
);

// 确认账单
Handler confirmedAmountHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    String sumCost = params['sumCost'].first;
    String startCost = params['startCost'].first;
    String timeCost = params['timeCost'].first;
    String distanceCost = params['distanceCost'].first;
    return ConfirmedAmount(
        orderId: orderId,
        sumCost: sumCost,
        startCost: startCost,
        timeCost: timeCost,
        distanceCost: distanceCost);
  },
);

// 行程结束(等待乘客付款)
Handler endTripHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String money = params['money'].first;
    return EndTrip(money: money);
  },
);

// 钱包
Handler walletHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return Wallet();
  },
);

// 提现
Handler cashWithdrawalHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    final money = params["money"].first;
    final type = params["type"].first;
    return CashWithdrawal(
      money: money,
      type: type,
    );
  },
);

// 提现申请已提交
Handler cashwithdrawalSubmissionHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return CashwithdrawalSubmission();
  },
);

// 我的行程
Handler itineraryOrderHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String gotoUrl = params['gotoUrl'].first;
    return ItineraryOrder(gotoUrl: gotoUrl);
  },
);

// 行程订单详情
Handler itineraryOrderDetailsHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    return ItineraryOrderDetails(id: id);
  },
);

// App设置
Handler appSetUpHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return AppSetUp();
  },
);

// 客服中心
Handler customerServiceCenterHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return CustomerServiceCenter();
  },
);

// 关于
Handler aboutHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return About();
  },
);

// 邀请好友
Handler inviteGoodFriendsHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return InviteGoodFriends();
  },
);

// webview
Handler webAppViewHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String url = params['url'].first;
    return WebAppView(url);
  },
);

// webview
Handler flutterInappwebviewHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String url = params['url'].first;
    // return FlutterInappwebview(url);
  },
);

/// 城际出行
// 城际出行去接乘客
Handler intercityPickUpPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orderId = params['orderId'].first;
    return IntercityPickUpPassengers(orderId: orderId);
  },
);

// 二维码收款设置金额
Handler setCollectionAmountHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String orginPoint = params['orginPoint'].first;
    String endPoint = params['endPoint'].first;
    String unitPrice = params['unitPrice'].first;
    return SetCollectionAmount(
        orginPoint: orginPoint, endPoint: endPoint, unitPrice: unitPrice);
  },
);

// 二维码收款
Handler intercityQrCodeCollectionHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return QrCodeCollection();
  },
);

// 顺风车输入位置
Handler locationSearchPageHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return LocationSearchPage();
  },
);

// 顺风车行程发布成功
Handler generateWindmillTripHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String start = params['start'].first;
    return GenerateWindmillTrip(
      id: id,
      start: start,
    );
  },
);

// 顺风车行程详情
Handler carpoolTripHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    return CarpoolTrip(id: id);
  },
);

// 顺风车乘客详情
Handler carpoolPassengerMapHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String type = params['type'].first;
    String first = params['first'].first;
    return CarpoolPassengerMap(
      type: type,
      first: first,
    );
  },
);

// 顺风车同行乘客
Handler carpoolFellowPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    return CarpoolFellowPassengers(id: id);
  },
);

// 顺风车同正在寻找乘客
Handler lookingPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String orderId = params['orderId'].first;
    String depArea = params['depArea'].first;
    String destArea = params['destArea'].first;
    return LookingPassengers(
      id: id,
      orderId: orderId,
      depArea: depArea,
      destArea: destArea,
    );
  },
);

// 顺风车捎上乘客
Handler takePassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String orderId = params['orderId'].first;
    return TakePassengers(id: id, orderId: orderId);
  },
);

// 顺风车行程进行步骤
Handler carpoolPickupPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String type = params['type'].first;
    return CarpoolPickupPassengers(id: id, type: type);
  },
);

// 实名认证
Handler realNameAuthenticationHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return RealNameAuthentication();
  },
);

// 我的二维码
Handler myQrCodeHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return MyQrCode();
  },
);

// 修改昵称
Handler modifyNicknameHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return ModifyNickname();
  },
);

// 城际班次乘客(查看乘客)
Handler flightPassengersHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    return FlightPassengers(id: id);
  },
);

// 城际扫码收款
Handler getOnByTicketHanderl = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String id = params['id'].first;
    String routerId = params['routerId'].first;
    String driverId = params['driverId'].first;
    return GetOnByTicket(id: id, routerId: routerId, driverId: driverId);
  },
);

// 录音授权
Handler getRecordAuthorization = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return AuthorizationRecord();
  },
);
// 录音协议r
Handler recordAgreement = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return AgreementRecord();
  },
);

//实名认证
Handler realNameAuthenHandler = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return RealNameAuthen();
  },
);

//我的信息
Handler personalDetailDataHandler = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return PersonalDetailData();
  },
);

//证件信息
Handler certificatesInfoHandler = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return CertificatesInfo();
  },
);

//账单明细
Handler billTabDetailHandler = Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    return BillTabDetail();
  },
);
